package com.eschool.beans;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.eschool.beans.datamodels.CourseDataModel;
import com.eschool.model.Course;
import com.eschool.service.SchoolManagementService;
import com.eschool.service.impl.SchoolManagementServiceImpl;

@ManagedBean(name="viewCoursesBean")
@ViewScoped
public class ViewCoursesBean {

	private List<Course> courses;
    private CourseDataModel model;
	private Course selectedCourse;
	private SchoolManagementService service;
	
	public ViewCoursesBean() {
		service = new SchoolManagementServiceImpl();
		model = new CourseDataModel();
		courses = service.getAllCourses();
	}
	
	public List<Course> getCourses() {
		return courses;
	}
	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}
	public Course getSelectedCourse() {
		return selectedCourse;
	}
	public void setSelectedCourse(Course selectedCourse) {
		this.selectedCourse = selectedCourse;
	}
	public CourseDataModel getModel() {
		return model;
	}
	public void setModel(CourseDataModel model) {
		this.model = model;
	}
}
